from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action

class WinningRoom(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        #add inventory items
        # build list of actions
        self.add_action(PlayAgain)    
        
    # return description of room.
    def get_description(self):
        return "You survived!!! Your keen survival instincts have served you well. But can you do it again?"
    # return image of room
    def get_image(self):
        return 'winningroom_pic.jpg'
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return WinningRoom

class WinningRoomHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return WinningRoom
    def get_template(self):
        return 'victory.html'
# define actions for this room

class PlayAgain(Action):
    def __init__(self):
        Action.__init__(self, "Play Again")    # do basic initialization for every action
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'restart'
    
    def get_description(self):
        return "Play Again"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"